<?php
namespace app\index\controller;
use think\Controller;
class News extends  Controller
{
    public function news()
    {
        return view();
    }

   public function companyNew()
    {
        //

        $companyNew=db('news')->where(array('on_sale'=>1,'type'=>1))->order('sort')->paginate(5);
        $this->assign(array(
           'companyNew'=>$companyNew,
        ));
        return view();
    }

    public function tradeNew()
    {
        $tradeNew=db('news')->where(array('on_sale'=>1,'type'=>0))->order('sort')->paginate(5);
        $this->assign(array(
            'tradeNew'=>$tradeNew,
        ));
        return view();
    }

     public function news_show(){
        $id=input('id');
        $news=db('news')->find($id);
        $this->assign(array('news'=>$news));
       return view();
     }


}
